package com.ship.boats.domain;

import cn.hutool.core.date.DatePattern;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ship.common.core.base.ContractBaseBean;
import com.ship.common.core.base.Joinable;
import com.ship.common.core.mapping.Label;
import com.ship.common.core.mapping.SearchItem;
import com.ship.common.core.mapping.TableColumn;
import com.ship.common.core.utils.DateUtil;
import com.ship.common.core.utils.StringUtils;
import com.ship.common.core.validate.Add;
import com.ship.common.core.validate.Update;
import com.ship.common.security.utils.SecurityUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

@TableName("con_shipping")
@Data
public class ConShipping extends ContractBaseBean implements Joinable {


    private static final long serialVersionUID = -8036870972187350076L;
    /**
     *执行编号
     */
    @Label(value="执行编号")
    @SearchItem
    @TableColumn
    private String contractNumber;

    /**
     *合同名称
     */
    @Label(value="合同名称")
    @SearchItem
    @TableColumn
    private String contractName;

    /**
     *合同类型（租入长期船、租入短期船、船舶租出、内部转租）
     */
    @Label(value="合同类型",enumContent = "船运合同类型",multiSelect = true)
    @SearchItem
//    @TableColumn
    private Integer contractType;

    @TableColumn
    @TableField(exist = false)
    @Label(value="合同类型",enumContent = "船运合同类型",multiSelect = true)
    private String contractTypeStr;

    @TableField(exist = false)
    private String contractTypeListForSearch;

    /**
     * 文件类型（term sheet,合同原件）
     */
    @Label(value="文件类型",enumContent = "文件类型",multiSelect=true)
    @SearchItem
//    @TableColumn
    @NotNull(message = "文件类型不能为空", groups = {Add.class})
    private Integer fileType;

    @TableColumn
    @TableField(exist = false)
    @Label(value="文件类型",enumContent = "文件类型",multiSelect=true)
    private String fileTypeStr;

    @TableField(exist = false)
    private String fileTypeListForSearch;

    /**
     *贸易主体(国贸、新贸)
     */
    @Label(value="合同主体",enumContent = "贸易主体",multiSelect = true)
    @SearchItem
//    @TableColumn
    @NotNull(message = "合同主体不能为空", groups = {Add.class})
    private Integer tradeBody;

    @TableColumn
    @TableField(exist = false)
    @Label(value="合同主体",enumContent = "贸易主体",multiSelect = true)
    private String tradeBodyStr;

    @TableField(exist = false)
    private String tradeBodyListForSearch;

    /**
     *签订日期
     */
    @Label(value="签订日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @SearchItem
//    @TableColumn
//    @NotNull(message = "签订日期不能为空", groups = {Add.class})
    private Date signingDate;

    @TableColumn
    @TableField(exist = false)
    @Label(value="签订日期")
    private String signingDateStr;

    /**
     *IMO
     */
    @Label(value="IMO")
    @TableColumn
    @NotBlank(message = "IMO不能为空", groups = {Update.class, Add.class})
    @Size(max = 255, message = "IMO长度不能超过255", groups = {Update.class, Add.class})
    private String imo;

    /**
     *船舶名称
     */
    @Label(value="船舶名称")
    @TableColumn
    @NotBlank(message = "船舶名称不能为空", groups = {Update.class, Add.class})
    @Size(max = 255, message = "船舶名称长度不能超过255", groups = {Update.class, Add.class})
    private String shipName;

    /**
     *船东
     */
    @Label(value="船东")
    @SearchItem
    @TableColumn
    @NotBlank(message = "船东不能为空", groups = {Update.class, Add.class})
    @Size(max = 255, message = "船东长度不能超过255", groups = {Update.class, Add.class})
    private String shipowner;

    /**
     *租家
     */
    @Label(value="租家")
    @SearchItem
    @TableColumn
    @NotBlank(message = "租家不能为空", groups = {Update.class, Add.class})
    @Size(max = 255, message = "租家长度不能超过255", groups = {Update.class, Add.class})
    private String tenant;

    /**
     *租期
     */
    @Label(value="租期")
//    @NotBlank(message = "租期不能为空", groups = {Update.class, Add.class})
//    @Size(max = 255, message = "租期长度不能超过255", groups = {Update.class, Add.class})
    private BigDecimal leaseTerm;

    /**
     *租期上浮误差值
     */
    @Label(value="租期上浮误差值")
    private Integer leaseTermValueUp;

    /**
     *租期下浮误差值
     */
    @Label(value="租期下浮误差值")
    private Integer leaseTermValueUpDown;

    /**
     * 租期拼接值
     */
    @Label(value="租期")
    @TableColumn
    private String leaseTermStr;

    /**
     *租金(每天)
     */
    @Label(value="租金")
    @NotNull(message = "租金不能为空", groups = {Update.class, Add.class})
    private BigDecimal rent;

    /**
     *租金(每天)
     */
    @Label(value="租金")
    @TableField(exist = false)
    @TableColumn
    private String rentStr;

    /**
     *交船日期-开始
     */
    @Label(value="交船日期-开始")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    private Date deliveryDateBegin;

    /**
     *交船日期-结束
     */
    @Label(value="交船日期-结束")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    private Date deliveryDateEnd;

    /**
     *交船日期-拼接值
     */
    @Label(value="合同交船日期")
    @TableColumn
    @TableField(exist = false)
    private String deliveryDate;

    /**
     *交船地点
     */
    @Label(value="合同交船地点")
    @TableColumn
    private String placeOfDeliveryOfShip;

    /**
     *还船日期-开始
     */
    @Label(value="还船日期-开始")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    private Date redeliveryDateBegin;

    /**
     *还船日期-结束
     */
    @Label(value="还船日期-结束")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    private Date redeliveryDateEnd;

    /**
     * 还船日期拼接值
     */
    @Label(value="合同还船日期")
    @TableColumn
    @TableField(exist = false)
    private String redeliveryDate;

    /**
     *还船地点
     */
    @Label(value="合同还船地点")
    @TableColumn
    private String placeOfRedeliveryOfShip;

    /**
     * 船速（Service Speed）
     */
    @Label(value="交还船费计算船速（Service Speed）")
    @SearchItem
    private BigDecimal shipSpeed;

    /**
     * 船速（Service Speed）
     */
    @Label(value="船速（Service Speed）")
    @TableField(exist = false)
    @TableColumn
    private String shipSpeedStr;

    /**
     *船速（交还船费）
     */
    @Label(value="交还船费计算油耗（Service Speed）")
    @SearchItem
    private BigDecimal shipSpeedForRedeliveryFee;

    /**
     *船速（交还船费）
     */
    @Label(value="交还船费计算油耗（Service Speed）")
    @TableField(exist = false)
    @TableColumn
    private String shipSpeedForRedeliveryFeeStr;

    /**
     *交船状态
     */
    @Label(value="交船状态")
    @SearchItem
    @TableColumn
    private String deliveryStatus;

    /**
     *交船状态自定义内容
     */
    @Label(value="交船状态自定义内容")
    private String deliveryStatusDetail;

    /**
     *还船状态(数值，单位立方米)
     */
    @Label(value="还船状态")
    @SearchItem
    private String redeliveryStatus;

    /**
     * 还船状态自定义内容
     */
    private String redeliveryStatusDetail;

    /**
     *还船状态数值单位-立方米
     */
    @Label(value="还船状态")
    @TableField(exist = false)
    @TableColumn
    private String redeliveryStatusStr;

    /**
     *交船燃油量·LSMGO
     */
    @Label(value="交船燃油量·LSMGO")
    @SearchItem
    private BigDecimal deliveryFuelQuantity;

    /**
     *交船燃油量·LSMGO
     */
    @Label(value="交船燃油量·LSMGO")
    @TableField(exist = false)
    @TableColumn
    private String deliveryFuelQuantityStr;

    /**
     *还船燃油量·LSMGO
     */
    @Label(value="还船燃油量·LSMGO")
    @SearchItem
    private BigDecimal refundFuelQuantity;

    /**
     *还船燃油量·LSMGO
     */
    @Label(value="还船燃油量·LSMGO")
    @TableField(exist = false)
    @TableColumn
    private String refundFuelQuantityStr;

    /**
     *交船燃油量·VLSFO
     */
    @Label(value="交船燃油量·VLSFO")
    @SearchItem
//    @TableColumn
    private BigDecimal vlDeliveryFuelQuantity;

    /**
     *交船燃油量·VLSFO
     */
    @Label(value="交船燃油量·VLSFO")
    @TableField(exist = false)
    @TableColumn
    private String vlDeliveryFuelQuantityStr;

    /**
     *还船燃油量·VLSFO
     */
    @Label(value="还船燃油量·VLSFO")
    @SearchItem
//    @TableColumn
    private BigDecimal vlRefundFuelQuantity;

    /**
     *还船燃油量·VLSFO
     */
    @Label(value="还船燃油量·VLSFO")
    @TableField(exist = false)
    @TableColumn
    private String vlRefundFuelQuantityStr;

    /**
     *交船LNG量
     */
    @Label(value="交船heel量")
    @SearchItem
    private BigDecimal deliveryLngVolume;

    /**
     *交船LNG量
     */
    @Label(value="交船heel量")
    @TableField(exist = false)
    @TableColumn
    private String deliveryLngVolumeStr;

    /**
     *还船LNG量
     */
    @Label(value="还船heel量")
    @SearchItem
    private BigDecimal lngQuantityReturnedToTheShip;

    /**
     *还船LNG量
     */
    @Label(value="还船heel量")
    @TableField(exist = false)
    @TableColumn
    private String lngQuantityReturnedToTheShipStr;

    /**
     *交船通知
     */
    @Label(value="交船通知规则")
    @TableColumn
    private String deliveryNotice;

    /**
     *还船通知
     */
    @Label(value="还船通知规则")
    @TableColumn
    private String redeliveryNotice;

    /**
     *舱容（单位立方米）
     */
    @Label(value="舱容")
    @SearchItem
    private BigDecimal cabinCapacity;

    /**
     *舱容单位-立方米
     */
    @Label(value="舱容")
    @TableField(exist = false)
    @TableColumn
    private String cabinCapacityStr;

    /**
     *交船费
     */
    @Label(value="交船费")
    private BigDecimal deliveryFee;

    /**
     *交船费
     */
    @Label(value="交船费")
    @TableField(exist = false)
//    @TableColumn
    private String deliveryFeeStr;

    /**
     * 交船Heel单价计价规则
     */
    @Label(value="交船Heel单价计价规则")
    @TableColumn
    private String deliveryFeeNew;

    /**
     * 还船Heel单价计价规则
     */
    @Label(value="还船Heel单价计价规则")
    @TableColumn
    private String redeliveryFeeNew;

    /**
     *还船费
     */
    @Label(value="还船heel单价")
    private BigDecimal redeliveryFee;

    /**
     *还船费
     */
    @Label(value="还船heel单价")
    @TableField(exist = false)
    @TableColumn
    private String redeliveryFeeStr;

    /**
     *宣布留底量(单位天)
     */
    @Label(value="宣布留底量")
    private Integer declareReserveAmount;

    /**
     *宣布留底量单位-天
     */
    @Label(value="宣布留底量")
    @TableField(exist = false)
    @TableColumn
    private String declareReserveAmountStr;

    /**
     * 权利方
     */
    @Label(value = "权利方")
    @TableColumn
    private String rightsHolder;

    /**
     *LNG价格（交船）
     */
    @Label(value="交船费计算规则")
    private String lngPriceDelivery;

    /**
     *LNG价格（交船）
     */
    @Label(value="交船费计算规则")
    @TableField(exist = false)
    @TableColumn
    private String lngPriceDeliveryStr;

    /**
     *LNG价格（还船）
     */
    @Label(value="还船费计算规则")
    private String lngPriceRedelivery;

    /**
     *LNG价格（还船）
     */
    @Label(value="还船费计算规则")
    @TableField(exist = false)
    @TableColumn
    private String lngPriceRedeliveryStr;

    /**
     *燃油使用原则(FIFO、LILO)
     */
    @Label(value="燃油使用原则",enumContent = "燃油使用原则",multiSelect = true)
    @SearchItem
//    @TableColumn
    private Integer fuelUsagePrinciples;

    @Label(value="燃油使用原则",enumContent = "燃油使用原则",multiSelect = true)
    @TableField(exist = false)
    @TableColumn
    private String fuelUsagePrinciplesStr;

    @TableField(exist = false)
    private String fuelUsagePrinciplesListForSearch;

    /**
     *船保证的满载蒸发率
     */
    @Label(value="船保证的满载蒸发率")
    @SearchItem
    private BigDecimal evaporationRate;

    /**
     * 蒸发率拼接值
     */
    @Label(value="船保证的满载蒸发率")
    @TableColumn
    @TableField(exist = false)
    private String evaporationRateStr;

    /**
     *船保证的空载蒸发率
     */
    @Label(value="船保证的空载蒸发率")
    @SearchItem
//    @TableColumn
    private BigDecimal emptyEvaporationRate;

    /**
     * 蒸发率拼接值
     */
    @Label(value="船保证的空载蒸发率")
    @TableColumn
    @TableField(exist = false)
    private String emptyEvaporationRateStr;

    /**
     *油耗保证（tons/day）
     */
    @Label(value="油耗保证")
    @SearchItem
    private BigDecimal oilConsumptionEnsure;

    /**
     *油耗保证（tons/day）
     */
    @Label(value="油耗保证")
    @TableField(exist = false)
    @TableColumn
    private String oilConsumptionEnsureStr;

    /**
     *币种
     */
    @Label(value="币种",enumContent = "币种",multiSelect = true)
    private Integer currency;

    @TableField(exist = false)
    private String currencyListForSearch;

    /**
     *合同状态
     */
    @Label(value="合同状态",enumContent = "船运合同状态",multiSelect = true)
    @SearchItem
//    @TableColumn
    private Integer status;

    @Label(value="合同状态",enumContent = "船运合同状态",multiSelect = true)
    @TableColumn
    @TableField(exist = false)
    private String statusStr;

    @TableField(exist = false)
    private String statusListForSearch;

    /**
     *删除申请
     */
    @Label(value="删除申请")
    private Integer delApply;

    /**
     *优秀案例
     */
    @Label(value="优秀案例",enumContent = "是否是优秀案例")
    private Integer excellent;

    /**
     * 附件地址
     */
    @TableField(exist = false)
    private String filePath;

    /**
     * 合同上传时间
     */
    @Label(value="合同上传时间")
//    @TableColumn
    @TableField(fill = FieldFill.INSERT)
    private Date createDate;

    @Label(value="合同上传时间")
    @TableColumn
    @TableField(exist = false)
    private String createDateStr;

    /**
     * 创建者
     */
    @Label(value="创建者")
    @SearchItem
    @TableColumn
    @TableField(fill = FieldFill.INSERT)
    private String createBy;


    /**
     *  off-hire
     */
    private String hireTimeValue;

    /**
     * FOE
     */
    @Label(value="FOE（油气转换系数）")
    @TableColumn
    private BigDecimal foe;

    /**
     * SIRE 证书有效持续时间
     */
    @Label(value="SIRE 证书有效持续时间")
    private String cerTime;

    /**
     * SIRE 证书有效持续时间
     */
    @Label(value="SIRE 证书有效持续时间")
    @TableField(exist = false)
    @TableColumn
    private String cerTimeStr;


    /**
     *  租金时间段，json字符串
     */
    @Label(value="租金时间段及租金")
    @TableColumn
    private String rentTimeSlot;

    /**
     *  距离
     */
    @Label(value="距离")
//    @TableColumn
    private Integer shipDistance;

    /**
     *  距离字符串
     */
    @Label(value="距离")
    @TableField(exist = false)
    @TableColumn
    private String shipDistanceStr;

    @ApiModelProperty(value = "船级社名称")
    private String classificationSociety;

    /**
     * 船级社代码
     */
    @ApiModelProperty(value = "船级社代码")
    private String classificationSocietyCode;

    @ApiModelProperty(value = "主推概述")
    private String primeMoverDescriptiveNarrative;

    @ApiModelProperty(value = "首款")
    private BigDecimal firstPrice;

    @ApiModelProperty(value = "每月租金")
    private String monthlyRent;

    @ApiModelProperty(value = "尾款")
    private String balancePayment;

    @ApiModelProperty(value = "租家账户信息")
    private String rentalAccountInformation;

    @ApiModelProperty(value = "船东账户信息")
    private String shipAccountInformation;

    @ApiModelProperty(value = "ETS结算时间")
    private String etsSettlementTime;

    private Date startingDateOfLeaseBegin;

    private Date startingDateOfLeaseEnd;

    @Label(value="删除流程")
    private String deleteProcessInstanceId;

    /**
     *  交船燃油量·LSMGO符号
     */
    private String deliveryFuelQuantitySymbol;

    /**
     *  还船燃油量·LSMGO符号
     */
    private String refundFuelQuantitySymbol;

    /**
     *  交船燃油量·VLSFO符号
     */
    private String vlDeliveryFuelQuantitySymbol;

    /**
     *  还船燃油量·VLSFO符号
     */
    private String vlRefundFuelQuantitySymbol;

    /**
     *  交船 heel 量符号
     */
    private String deliveryLngVolumeSymbol;

    /**
     *  还船 heel 量符号
     */
    private String lngQuantityReturnedToTheShipSymbol;

    /**
     * 交船Heel热值系数转换规则
     */
    private String ruleConversionHeelHeat;

    /**
     * 交船Heel热值系数转换规则自定义内容
     */
    private String ruleConversionHeelHeatCustom;

    /**
     * 付款时间
     */
    private String paymentTime;

    /**
     * 航运经纪人
     */
    private String shipBroker;

    /**
     * 是否有做过SSCS就加入Primary List的权利(1:有，2：无)
     */
    private Integer sscsJoinPrimary;

    /**
     * 合同交船日期类型、还船日期类型（LT、UTC）
     */
    private String deliveryDateType;

    /**
     * 还船Heel热值系数转换规则
     */
    private String returnConversionHeelHeat;

    /**
     * 还船Heel热值系数转换规则自定义内容
     */
    private String returnConversionHeelHeatCustom;

    /**
     * 首款单位，1：工作日/2：自然日
     */
    private Integer firstPriceUnit;

    /**
     * 首款文本
     */
    private String firstPriceText;


    /**
     * 尾款单位：1：工作日/2：自然日
     */
    private Integer balancePaymentUnit;

    /**
     * 尾款文本
     */
    private String balancePaymentText;

    /**
     * 交船状态时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date deliveryStatusTime;

    /**
     * 总吨
     */
    @TableField(exist = false)
    private BigDecimal grossTonnage;

    /**
     * 净吨
     */
    @TableField(exist = false)
    private BigDecimal netTonnage;

    public String getShipDistanceStr(){
        String result = null;
        if (getShipDistance()!=null){
            //result = decimalFormat.format(getDeliveryFee());
            result = getShipDistance()+"海里";
        }
        return result;
    }

    public String getCerTimeStr(){
        String result = null;
//        String time = getCerTime();
        String startDateStr = getCerTime();
//        Date startDate =  getCerTime();
        if(startDateStr == null){
            return "";
        }
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date startDate;

        try {
            startDate = dateFormat.parse(startDateStr);
        } catch (Exception e) {
            return "";
        }

        Calendar calendar = Calendar.getInstance();
        calendar.setTime(startDate);

        // 将日期调整为6个月后
        calendar.add(Calendar.MONTH, 6);
        Date endDate = calendar.getTime();

        SimpleDateFormat resultFormat  = new SimpleDateFormat("yyyy年MM月dd日");
        String start = resultFormat.format(startDate);
        String end = resultFormat.format(endDate);
        return start + " - " + end;
    }

    public String getDeliveryDate(){
        Date startDate =  getDeliveryDateBegin();
        Date endDate =  getDeliveryDateEnd();
        if(startDate == null || endDate == null){
            return null;
        }
        String start = DateUtil.date2Str(startDate,"yyyy年MM月dd日HH:mm");
        String end = DateUtil.date2Str(endDate,"yyyy年MM月dd日HH:mm");
        return start + "-" + end;
    }
    public String getRedeliveryDate(){
        Date startDate =  getRedeliveryDateBegin();
        Date endDate =  getRedeliveryDateEnd();
        if(startDate == null || endDate == null){
            return null;
        }
        String start = DateUtil.date2Str(startDate,"yyyy年MM月dd日HH:mm");
        String end = DateUtil.date2Str(endDate,"yyyy年MM月dd日HH:mm");
        return start + "-" + end;
    }

    public String getLeaseTermStr(){
        BigDecimal leaseTerm = getLeaseTerm();

        if(leaseTerm == null){
            return null;
        }
        String result;
        if (getLeaseTermValueUp() == getLeaseTermValueUpDown()){
            result =  decimalFormat.format(leaseTerm)+ "±" + getLeaseTermValueUpDown().toString();
        }else {
            if (getLeaseTermValueUp() == null && getLeaseTermValueUpDown() == null){
                result = decimalFormat.format(leaseTerm)+"天";
            }
            else if (getLeaseTermValueUp() == null){
                result = decimalFormat.format(leaseTerm) + "-" + getLeaseTermValueUpDown().toString()+"天";
            }
            else if (getLeaseTermValueUpDown() == null){
                result = decimalFormat.format(leaseTerm) + "+" + getLeaseTermValueUp().toString()+"天";
            }
            else {
                result = decimalFormat.format(leaseTerm) + "+" + getLeaseTermValueUp().toString() + "-" + getLeaseTermValueUpDown().toString()+"天";
            }
        }
        return result;
    }

    public String getEvaporationRateStr(){
        String result = null;
        if (getEvaporationRate()!=null){
            result = numericFormatting(getEvaporationRate())+"%";}
        return result;
    }

    public String getEmptyEvaporationRateStr(){
        String result = null;
        if (getEmptyEvaporationRate()!=null){
            result = getEmptyEvaporationRate()+"%";}
        return result;
    }
    public String getShipSpeedStr(){
        String result = null;
        if (getShipSpeed()!=null){
            result = decimalFormat.format(getShipSpeed());
            result = result+" Knots";}
        return result;
    }
    public String getShipSpeedForRedeliveryFeeStr(){
        String result = null;
        if (getShipSpeedForRedeliveryFee()!=null){
            result = decimalFormat.format(getShipSpeedForRedeliveryFee());
            result = result+" MT/吨";}
        return result;
    }

    //    public String getRedeliveryStatusStr(){
//        String result = null;
//        if (getRedeliveryStatus()!=null){
//            result = decimalFormat.format(getRedeliveryStatus());
//            result = result+"m³";}
//        return result;
//    }
    public String getDeliveryFuelQuantityStr(){
        String result = null;
        if (getDeliveryFuelQuantity()!=null){
            result = decimalFormat.format(getDeliveryFuelQuantity());
            result = getDeliveryFuelQuantitySymbol()+result+"MT";}
        return result;
    }
    public String getRefundFuelQuantityStr(){
        String result = null;
        if (getRefundFuelQuantity()!=null){
            result = decimalFormat.format(getRefundFuelQuantity());
            result = getRefundFuelQuantitySymbol() + result+"MT";}
        return result;
    }
    public String getVlDeliveryFuelQuantityStr(){
        String result = null;
        if (getVlDeliveryFuelQuantity()!=null){
            result = decimalFormat.format(getVlDeliveryFuelQuantity());
            //result = getVlDeliveryFuelQuantity().toString();
            result = getVlDeliveryFuelQuantitySymbol() + result+"MT";}
        return result;
    }
    public String getVlRefundFuelQuantityStr(){
        String result = null;
        if (getVlRefundFuelQuantity()!=null){
            result = decimalFormat.format(getVlRefundFuelQuantity());
            //result = getVlrefundFuelQuantity().toString();
            result = getVlRefundFuelQuantitySymbol() + result+"MT";}
        return result;
    }
    public String getDeliveryLngVolumeStr(){
        String result = null;
        if (getDeliveryLngVolume()!=null){
            result = decimalFormat.format(getDeliveryLngVolume());
            result = getDeliveryLngVolumeSymbol() + result+"m³";}
        return result;
    }
    public String getLngQuantityReturnedToTheShipStr(){
        String result = null;
        if (getLngQuantityReturnedToTheShip()!=null){
            result = decimalFormat.format(getLngQuantityReturnedToTheShip());
            result = getLngQuantityReturnedToTheShipSymbol() + result +"m³";}
        return result;
    }
    public String getCabinCapacityStr(){
        String result = null;
        if (getCabinCapacity()!=null){
            result = decimalFormat.format(getCabinCapacity());
            result = result+"m³";}
        return result;
    }
    public String getDeliveryFeeStr(){
        String result = null;
        if (getDeliveryFee()!=null){
            result = decimalFormat.format(getDeliveryFee());
            if (currency == 1) {
                result = "$" + result;
            }
            if (currency == 2) {
                result = "¥" + result;
            }
            if (currency == 3) {
                result = "€" + result;
            }
            if (currency == 4) {
                result = "￡" + result;
            }
            if (currency == 5) {
                result = "C$" + result;
            }
            if (currency == 6) {
                result = "￥" + result;
            }
            if (currency == 7) {
                result = "₹" + result;
            }
            if (currency == 8) {
                result = "p" + result;
            }
            if (currency == 9) {
                result = "₽" + result;
            }
        }
        return result;
    }
    public String getRedeliveryFeeStr(){
        String result = null;
        if (getRedeliveryFee()!=null){
            result = decimalFormat.format(getRedeliveryFee());
            if (currency == 1) {
                result = "$" + result;
            }
            if (currency == 2) {
                result = "¥" + result;
            }
            if (currency == 3) {
                result = "€" + result;
            }
            if (currency == 4) {
                result = "￡" + result;
            }
            if (currency == 5) {
                result = "C$" + result;
            }
            if (currency == 6) {
                result = "￥" + result;
            }
            if (currency == 7) {
                result = "₹" + result;
            }
            if (currency == 8) {
                result = "p" + result;
            }
            if (currency == 9) {
                result = "₽" + result;
            }
        }
        return result;
    }
    public String getDeclareReserveAmountStr(){
        String result = null;
        if (getDeclareReserveAmount()!=null){
            result = decimalFormat.format(getDeclareReserveAmount());
            result = result+"天";}
        return result;
    }
    public String getLngPriceDeliveryStr(){
        String result = null;
        if (StringUtils.isNotEmpty(getLngPriceDelivery())){
            //result = decimalFormat.format(getLngPriceDelivery());
            result = getLngPriceDelivery();
            if (currency == 1) {
                result = "$" + result;
            }
            if (currency == 2) {
                result = "¥" + result;
            }
            if (currency == 3) {
                result = "€" + result;
            }
            if (currency == 4) {
                result = "￡" + result;
            }
            if (currency == 5) {
                result = "C$" + result;
            }
            if (currency == 6) {
                result = "￥" + result;
            }
            if (currency == 7) {
                result = "₹" + result;
            }
            if (currency == 8) {
                result = "p" + result;
            }
            if (currency == 9) {
                result = "₽" + result;
            }
        }
        return result;
    }
    public String getLngPriceRedeliveryStr(){
        String result = null;
        if (StringUtils.isNotEmpty(getLngPriceRedelivery())){
            //result = decimalFormat.format(getLngPriceRedelivery());
            result = getLngPriceRedelivery();
            if (currency == 1) {
                result = "$" + result;
            }
            if (currency == 2) {
                result = "¥" + result;
            }
            if (currency == 3) {
                result = "€" + result;
            }
            if (currency == 4) {
                result = "￡" + result;
            }
            if (currency == 5) {
                result = "C$" + result;
            }
            if (currency == 6) {
                result = "￥" + result;
            }
            if (currency == 7) {
                result = "₹" + result;
            }
            if (currency == 8) {
                result = "p" + result;
            }
            if (currency == 9) {
                result = "₽" + result;
            }
        }
        return result;
    }
    public String getOilConsumptionEnsureStr(){
        String result = null;
        if (getOilConsumptionEnsure()!=null){
            result = decimalFormat.format(getOilConsumptionEnsure());
            result = result+"tons/day";}
        return result;
    }



    public String getRentStr(){
//        if(SecurityUtils.getLoginUser() != null && !SecurityUtils.isAdmin(SecurityUtils.getUserId())
//                && SecurityUtils.getLoginUser().getPermissionString().indexOf("spcon:price:show") < 0){
//            return "***";
//        }
        String result = null;
        if (getRent()!=null) {
            result = decimalFormat.format(getRent());

            if (currency == 1) {
                result = "$" + result;
            }
            if (currency == 2) {
                result = "¥" + result;
            }
            if (currency == 3) {
                result = "€" + result;
            }
            if (currency == 4) {
                result = "￡" + result;
            }
            if (currency == 5) {
                result = "$" + result;
            }
            if (currency == 6) {
                result = "￥" + result;
            }
            if (currency == 7) {
                result = "₹" + result;
            }
            if (currency == 8) {
                result = "p" + result;
            }
            if (currency == 9) {
                result = "₽" + result;
            }
        }
        return result;

    }

    public String getContractTypeStr(){
        String result = null;
        if (getContractType()!=null){
            if (contractType == 1){
                result = "租入长期船";
            }else if (contractType == 2){
                result = "租入短期船";
            }else if (contractType == 3){
                result = "船舶租出";
            }else{
                result = "内部转租";
            }
        }
        return result;
    }

    public String getFileTypeStr(){
        String result = null;
        if (getFileType()!=null){
            if (fileType == 1){
                result = "term sheet";
            }
            if (fileType == 2){
                result = "合同原件";
            }
        }
        return result;
    }

    public String getTradeBodyStr(){
        String result = null;
        if (getTradeBody()!=null){
            if (tradeBody == 1){
                result = "国贸";
            }
            if (tradeBody == 2){
                result = "新贸";
            }
        }
        return result;
    }

    public String getSigningDateStr() {
        String SigningDateStr = null;
        if (null != this.getSigningDate()){
            SigningDateStr = cn.hutool.core.date.DateUtil.format(this.getSigningDate(), DatePattern.NORM_DATE_FORMATTER);
        }
        return SigningDateStr;
    }

    public String getCreateDateStr() {
        String createDateStr = null;
        if (null != this.getCreateDate()){
            createDateStr = cn.hutool.core.date.DateUtil.format(this.getCreateDate(), DatePattern.NORM_DATETIME_FORMATTER);
        }
        return createDateStr;
    }

    public String getStatusStr(){
        String result = null;
        if (getStatus()!=null){
            if (status == 1){
                result = "草稿中";
            }
            if (status == 2){
                result = "已签订";
            }
            if (status == 3){
                result = "执行中";
            }
            if (status == 4){
                result = "已完成";
            }
            if (status == 6){
                result = "off-hire";
            }
        }
        return result;
    }

    public String getFuelUsagePrinciplesStr(){
        String result = null;
        if (getFuelUsagePrinciples()!=null){
            if (fuelUsagePrinciples == 1){
                result = "FIFO";
            }
            if (fuelUsagePrinciples == 2){
                result = "LIFO";
            }
            if (fuelUsagePrinciples == 3){
                result = "LILO";
            }
        }
        return result;
    }


    @Override
    public String getLabel() {
        return null;
    }

    @Override
    public String getValue() {
        return null;
    }
}
